import React from "react"
import { useContext } from "react"

export const DispatchContext = React.createContext()
// 自定义钩子函数命名的要求：use开头的函数
// useState/useEffect/useContext
export const useDispatch = () => {
  return useContext(DispatchContext) // 函数组件和context耦合性降低
}